const router = require('koa-router')();
const usercoms = require('../modules/usercoms');

//获取数据
router.get('/usercoms',async(ctx,next) => {
    ctx.body = await usercoms.getUsercoms();
})
//增加数据
router.post('/usercoms',async(ctx,next) => {
    ctx.body = await usercoms.addUsercoms(ctx.request.body);
})
//删除数据
router.delete('/usercoms/:key0',async(ctx,next) => {
    ctx.body = await usercoms.deleteUsercoms(ctx.params);
})
//修改数据
router.put('/usercoms',async(ctx,next)=>{
    ctx.body = await usercoms.putUsercoms(ctx.request.body);
})

module.exports = router;
